package edu.tjufe.llp.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.tjufe.llp.entity.User;
import org.springframework.stereotype.Service;
import edu.tjufe.llp.mapper.ChargeAreaMapper;
import edu.tjufe.llp.entity.ChargeArea;
import edu.tjufe.llp.service.IChargeAreaService;

import javax.annotation.Resource;

/**
 * 充电区域Service业务层处理
 *
 * @author leiliping
 * @date 2022-12-24
 */
@Service
public class ChargeAreaServiceImpl extends ServiceImpl<ChargeAreaMapper, ChargeArea> implements IChargeAreaService
{
    @Resource
    private ChargeAreaMapper chargeAreaMapper;

    /**
     * 查询充电区域
     *
     * @param areaId 充电区域主键
     * @return 充电区域
     */
    @Override
    public ChargeArea selectChargeAreaByAreaId(Integer areaId)
    {
        return chargeAreaMapper.selectChargeAreaByAreaId(areaId);
    }

    /**
     * 查询充电区域列表
     *
     * @param chargeArea 充电区域
     * @return 充电区域
     */
    @Override
    public List<ChargeArea> selectChargeAreaList(ChargeArea chargeArea)
    {
        return chargeAreaMapper.selectChargeAreaList(chargeArea);
    }

    /**
     * 新增充电区域
     *
     * @param chargeArea 充电区域
     * @return 结果
     */
    @Override
    public int insertChargeArea(ChargeArea chargeArea)
    {
        return chargeAreaMapper.insertChargeArea(chargeArea);
    }

    /**
     * 修改充电区域
     *
     * @param chargeArea 充电区域
     * @return 结果
     */
    @Override
    public int updateChargeArea(ChargeArea chargeArea)
    {
        return chargeAreaMapper.updateChargeArea(chargeArea);
    }

    /**
     * 批量删除充电区域
     *
     * @param areaIds 需要删除的充电区域主键
     * @return 结果
     */
    @Override
    public int deleteChargeAreaByAreaIds(Integer[] areaIds)
    {
        return chargeAreaMapper.deleteChargeAreaByAreaIds(areaIds);
    }

    /**
     * 删除充电区域信息
     *
     * @param areaId 充电区域主键
     * @return 结果
     */
    @Override
    public int deleteChargeAreaByAreaId(Integer areaId)
    {
        return chargeAreaMapper.deleteChargeAreaByAreaId(areaId);
    }

    @Override
    public int selectTotal() {
        return chargeAreaMapper.selectTotal();
    }

    @Override
    public Page<ChargeArea> findPage(Page<ChargeArea> page, String areaName) {
        return chargeAreaMapper.findPage(page, areaName);
    }


}
